package com.example.controller.shangPinController;

import com.example.pojo.shangPinTree.Node;
import com.example.service.shangPinService.JsProductCategroyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author:郭
 * @Description: TODO
 * @Date: 2022/11/13 8:28
 * @ClassName JsProductCategroyController
 * 商品分类表
 */
@RequestMapping("/shangpin")
@Controller
public class JsProductCategroyController {
    @Autowired
    private JsProductCategroyService jservice;
    /**
     * @Author: 郭
     * @Date: 2022/11/13 9:56
     * 全查商品分类表中的全部数据，实现tree
     * @Param:
     * @Return:
     */
    @RequestMapping("/getAll")
    @ResponseBody
    public List<Node> getAll(){
        List<Node> all = jservice.getAll();
        return all;
    }
}
